package com.test.spring.annotation;

import com.test.spring.annotation.controller.UserController;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/9/25 20:59
 */
public class Main {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("beans-annocation.xml");
        /*TestObject testObject = ctx.getBean("testObject", TestObject.class);
        System.out.println(testObject);

        UserRepository repository = ctx.getBean("userRepository", UserRepository.class);
        repository.save();

        UserService service = ctx.getBean("userService", UserService.class);
        service.add();*/

        UserController controller = ctx.getBean("userController", UserController.class);
        controller.execute();
        ;
    }
}
